const user = {
    state: sessionStorage.userState ? JSON.parse(sessionStorage.userState) : {
        user: {
            username: ''
        }
    },
    getters:{
        getUser(state){
            return state.user;
        }
    },
    mutations:{
        updateUser(state,user){
            state.user=user;
        }
    },
    actions:{
        asyncUpdateUser(context, user) {
            context.commit('updateUser',user);
        }
    }
};
export default user;